/*
 * Copyright (c) 2019 Hitevision
 */

package tw.com.hitevision.whiteboard.android;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.util.Log;

import androidx.annotation.ColorInt;
import tw.com.hitevision.whiteboard.android.state.HighlighterProperty;
import tw.com.hitevision.whiteboard.android.state.PageProperty;
import tw.com.hitevision.whiteboard.android.state.PenProperty;
import tw.com.hitevision.whiteboard.android.util.SystemPropertiesUtils;

public class Settings {
    private static final String TAG = Settings.class.getSimpleName();
    private static final String PREFS_NAME = "whiteboard_settings";
    private int curImplementRecognitionMode = IMPLEMENT_RECOGNITION_OFF;

    private static class SettingsHolder {
        private static Settings sInstance;
        private static void createSettings (Context context) {
            sInstance = new Settings(context);
        }
    }

    public static synchronized Settings getInstance(Context context) {
        if (SettingsHolder.sInstance == null) {
            SettingsHolder.createSettings(context);
        }
        return SettingsHolder.sInstance;
    }

    private final SharedPreferences prefs;

    private Settings(Context context) {
        prefs = context.getSharedPreferences(PREFS_NAME, 0);

        Resources res = context.getResources();

        // the following comment is for redesign, just keep for check if init is wrong
//        WB_PEN_FINGER_DEFAULT_COLOR = res.getColor(R.color.pen_black);
//        WB_PEN_STYLUS_DEFAULT_COLOR = res.getColor(R.color.pen_black);
//        WB_HL_FINGER_DEFAULT_COLOR = res.getColor(R.color.highlight_yellow);
//        WB_HL_STYLUS_DEFAULT_COLOR = res.getColor(R.color.highlight_yellow);
//
//        AN_PEN_FINGER_DEFAULT_COLOR = res.getColor(R.color.pen_black);
//        AN_PEN_STYLUS_DEFAULT_COLOR = res.getColor(R.color.pen_black);
//        AN_HL_FINGER_DEFAULT_COLOR = res.getColor(R.color.highlight_yellow);
//        AN_HL_STYLUS_DEFAULT_COLOR = res.getColor(R.color.highlight_yellow);


        // change color to fit VN init
        WB_PEN_FINGER_DEFAULT_COLOR = res.getColor(R.color.pen_red);
        WB_PEN_STYLUS_DEFAULT_COLOR = res.getColor(R.color.pen_white);
        WB_HL_FINGER_DEFAULT_COLOR = res.getColor(R.color.highlight_yellow);
        WB_HL_STYLUS_DEFAULT_COLOR = res.getColor(R.color.highlight_yellow);

        AN_PEN_FINGER_DEFAULT_COLOR = res.getColor(R.color.pen_red);
        AN_PEN_STYLUS_DEFAULT_COLOR = res.getColor(R.color.pen_black);
        AN_HL_FINGER_DEFAULT_COLOR = res.getColor(R.color.highlight_yellow);
        AN_HL_STYLUS_DEFAULT_COLOR = res.getColor(R.color.highlight_yellow);


    }

    public int getImplementRecognitionMode() {
        return prefs.getInt(KEY_IMPLEMENT_RECOGNITION_MODE, Settings.IMPLEMENT_RECOGNITION_ALL);
    }

    public void setImplementRecognitionMode(int mode) {
        prefs.edit().putInt(KEY_IMPLEMENT_RECOGNITION_MODE, mode).apply();
    }


    public void setDetectAppClosedForcefully(boolean closed) {
        prefs.edit().putBoolean(KEY_DETECT_APP_CLOSED_FORCEFULLY, closed).apply();
    }

    public void setFlagNeedTutorial(boolean b) {
        prefs.edit().putBoolean(KEY_NEED_SHOW_TUTORIAL, b).apply();
    }

    public int getCurImplementRecognitionMode(){
        return curImplementRecognitionMode;
    }

    public boolean getFlagNeedTutorial() {
        return prefs.getBoolean(KEY_NEED_SHOW_TUTORIAL, true);
    }

    public boolean getDetectAppClosedForcefully() {
        return prefs.getBoolean(KEY_DETECT_APP_CLOSED_FORCEFULLY, false);
    }

    public void setPageMenuSettingColor(PageProperty.Color color) {
        prefs.edit().putInt(KEY_PAGE_MENU_COLOR_SETTING, color.ordinal()).apply();
    }

    public PageProperty.Color getPageMenuSettingColorEnum() {
        int value = prefs.getInt(KEY_PAGE_MENU_COLOR_SETTING,
                Props.getFlavorModel().equals(Props.Flavor.Model.Oem) ? PAGE_MENU_DEFAULT_COLOR_OEM.ordinal() : PAGE_MENU_DEFAULT_COLOR.ordinal());
//        int value = prefs.getInt(KEY_PAGE_MENU_COLOR_SETTING, PAGE_MENU_DEFAULT_COLOR.ordinal());

        for (PageProperty.Color color : PageProperty.Color.values()) {
            if (value == color.ordinal()) {
                return color;
            }
        }

//        return PAGE_MENU_DEFAULT_COLOR;
        return Props.getFlavorModel().equals(Props.Flavor.Model.Oem) ? PAGE_MENU_DEFAULT_COLOR_OEM : PAGE_MENU_DEFAULT_COLOR;
    }

    public void setPageMenuSettingPattern(PageProperty.Pattern pattern) {
        prefs.edit().putInt(KEY_PAGE_MENU_PATTERN_SETTING, pattern.ordinal()).apply();
    }

    public PageProperty.Pattern getPageMenuSettingPatternEnum() {
        int value = prefs.getInt(KEY_PAGE_MENU_PATTERN_SETTING, PAGE_MENU_DEFAULT_PATTERN.ordinal());

        for (PageProperty.Pattern pattern : PageProperty.Pattern.values()) {
            if (value == pattern.ordinal()) {
                return pattern;
            }
        }

        return PAGE_MENU_DEFAULT_PATTERN;
    }

    public void setPenColorSize(@ColorInt int color, PenProperty.Size size, boolean isAnnotation, boolean isFinger) {
        if (isAnnotation) {
            if (isFinger) {
                prefs.edit().putInt(KEY_AN_PEN_FINGER_COLOR, color).apply();
                prefs.edit().putInt(KEY_AN_PEN_FINGER_STROKE, size.ordinal()).apply();
            } else {
                prefs.edit().putInt(KEY_AN_PEN_STYLUS_COLOR, color).apply();
                prefs.edit().putInt(KEY_AN_PEN_STYLUS_STROKE, size.ordinal()).apply();
            }
        } else {
            if (isFinger) {
                prefs.edit().putInt(KEY_WB_PEN_FINGER_COLOR, color).apply();
                prefs.edit().putInt(KEY_WB_PEN_FINGER_STROKE, size.ordinal()).apply();
            } else {
                prefs.edit().putInt(KEY_WB_PEN_STYLUS_COLOR, color).apply();
                prefs.edit().putInt(KEY_WB_PEN_STYLUS_STROKE, size.ordinal()).apply();
            }
        }
    }

    public void setPenColorSize(@ColorInt int color, PenProperty.Size size) {
        prefs.edit().putInt(KEY_WB_PEN_FINGER_COLOR, color).apply();
        prefs.edit().putInt(KEY_WB_PEN_FINGER_STROKE, size.ordinal()).apply();
    }

    public @ColorInt int getPenColor(boolean isAnnotation, boolean isFinger) {
        boolean isOEM = Props.getFlavorModel().equals(Props.Flavor.Model.Oem);
        if (isAnnotation) {
            if (isFinger) {
                return prefs.getInt(KEY_AN_PEN_FINGER_COLOR, isOEM ? AN_PEN_FINGER_DEFAULT_COLOR_OEM : AN_PEN_FINGER_DEFAULT_COLOR);
            } else {
                return prefs.getInt(KEY_AN_PEN_STYLUS_COLOR, isOEM ? AN_PEN_STYLUS_DEFAULT_COLOR_OEM : AN_PEN_STYLUS_DEFAULT_COLOR);
            }
        } else {
            if (isFinger) {
                return prefs.getInt(KEY_WB_PEN_FINGER_COLOR, isOEM ? WB_PEN_FINGER_DEFAULT_COLOR_OEM : WB_PEN_FINGER_DEFAULT_COLOR);
            } else {
                return prefs.getInt(KEY_WB_PEN_STYLUS_COLOR, isOEM ? WB_PEN_STYLUS_DEFAULT_COLOR_OEM : WB_PEN_STYLUS_DEFAULT_COLOR);
            }
        }
    }

    public @ColorInt int getPenColor() {
//        return prefs.getInt(KEY_WB_PEN_FINGER_COLOR, WB_PEN_FINGER_DEFAULT_COLOR);
        return prefs.getInt(KEY_WB_PEN_STYLUS_COLOR, WB_PEN_STYLUS_DEFAULT_COLOR);
    }

    public PenProperty.Size getPenSize(boolean isAnnotation, boolean isFinger) {
        int sizeEnumValue;
        PenProperty.Size defaultSize;

        if (isAnnotation) {
            if (isFinger) {
                sizeEnumValue = prefs.getInt(KEY_AN_PEN_FINGER_STROKE, ANNOTATION_PEN_FINGER_DEFAULT_STROKE.ordinal());
                defaultSize = ANNOTATION_PEN_FINGER_DEFAULT_STROKE;
            } else {
                sizeEnumValue = prefs.getInt(KEY_AN_PEN_STYLUS_STROKE, ANNOTATION_PEN_STYLUS_DEFAULT_STROKE.ordinal());
                defaultSize = ANNOTATION_PEN_STYLUS_DEFAULT_STROKE;
            }
        } else {
            if (isFinger) {
                sizeEnumValue = prefs.getInt(KEY_WB_PEN_FINGER_STROKE, WHITEBOARD_PEN_FINGER_DEFAULT_STROKE.ordinal());
                defaultSize = WHITEBOARD_PEN_FINGER_DEFAULT_STROKE;
            } else {
                sizeEnumValue = prefs.getInt(KEY_WB_PEN_STYLUS_STROKE, WHITEBOARD_PEN_STYLUS_DEFAULT_STROKE.ordinal());
                defaultSize = WHITEBOARD_PEN_STYLUS_DEFAULT_STROKE;
            }
        }

        for (PenProperty.Size size : PenProperty.Size.values()) {
            if (size.ordinal() == sizeEnumValue) {
                return size;
            }
        }

        return defaultSize;
    }

    public PenProperty.Size getPenSize() {
//        int sizeEnumValue = prefs.getInt(KEY_WB_PEN_FINGER_STROKE, WHITEBOARD_PEN_FINGER_DEFAULT_STROKE.ordinal());
        int sizeEnumValue = prefs.getInt(KEY_WB_PEN_STYLUS_STROKE, WHITEBOARD_PEN_STYLUS_DEFAULT_STROKE.ordinal());

        for (PenProperty.Size size : PenProperty.Size.values()) {
            if (size.ordinal() == sizeEnumValue) {
                return size;
            }
        }

        return WHITEBOARD_PEN_FINGER_DEFAULT_STROKE;
    }

    public void setHighlighterColorSize(@ColorInt int color, HighlighterProperty.Size size, boolean isAnnotation, boolean isFinger) {
        if (isAnnotation) {
            if (isFinger) {
                prefs.edit().putInt(KEY_AN_HL_FINGER_COLOR, color).apply();
                prefs.edit().putInt(KEY_AN_HL_FINGER_STROKE, size.ordinal()).apply();
            } else {
                prefs.edit().putInt(KEY_AN_HL_STYLUS_COLOR, color).apply();
                prefs.edit().putInt(KEY_AN_HL_STYLUS_STROKE, size.ordinal()).apply();
            }
        } else {
            if (isFinger) {
                prefs.edit().putInt(KEY_WB_HL_FINGER_COLOR, color).apply();
                prefs.edit().putInt(KEY_WB_HL_FINGER_STROKE, size.ordinal()).apply();
            } else {
                prefs.edit().putInt(KEY_WB_HL_STYLUS_COLOR, color).apply();
                prefs.edit().putInt(KEY_WB_HL_STYLUS_STROKE, size.ordinal()).apply();
            }
        }
    }

    public @ColorInt int getHighlighterColor(boolean isAnnotation, boolean isFinger) {
        boolean isOEM = Props.getFlavorModel().equals(Props.Flavor.Model.Oem);
        if (isAnnotation) {
            if (isFinger) {
                return prefs.getInt(KEY_AN_HL_FINGER_COLOR, isOEM ? AN_HL_FINGER_DEFAULT_COLOR_OEM : AN_HL_FINGER_DEFAULT_COLOR);
            } else {
                return prefs.getInt(KEY_AN_HL_STYLUS_COLOR, isOEM ? AN_HL_STYLUS_DEFAULT_COLOR_OEM : AN_HL_STYLUS_DEFAULT_COLOR);
            }
        } else {
            if (isFinger) {
                return prefs.getInt(KEY_WB_HL_FINGER_COLOR, isOEM ? WB_HL_FINGER_DEFAULT_COLOR_OEM : WB_HL_FINGER_DEFAULT_COLOR);
            } else {
                return prefs.getInt(KEY_WB_HL_STYLUS_COLOR, isOEM ? WB_HL_STYLUS_DEFAULT_COLOR_OEM : WB_HL_STYLUS_DEFAULT_COLOR);
            }
        }
    }

    public @ColorInt int getHighlighterColor() {
//        return prefs.getInt(KEY_WB_HL_FINGER_COLOR, WB_HL_FINGER_DEFAULT_COLOR);
        return prefs.getInt(KEY_WB_HL_STYLUS_COLOR, WB_HL_STYLUS_DEFAULT_COLOR);
    }

    public HighlighterProperty.Size getHighlighterSize(boolean isAnnotation, boolean isFinger) {
        int sizeEnumValue;
        HighlighterProperty.Size defaultSize;

        if (isAnnotation) {
            if (isFinger) {
                sizeEnumValue = prefs.getInt(KEY_AN_HL_FINGER_STROKE, ANNOTATION_HL_FINGER_DEFAULT_STROKE.ordinal());
                defaultSize = ANNOTATION_HL_FINGER_DEFAULT_STROKE;
            } else {
                sizeEnumValue = prefs.getInt(KEY_AN_HL_STYLUS_STROKE, ANNOTATION_HL_STYLUS_DEFAULT_STROKE.ordinal());
                defaultSize = ANNOTATION_HL_STYLUS_DEFAULT_STROKE;
            }
        } else {
            if (isFinger) {
                sizeEnumValue = prefs.getInt(KEY_WB_HL_FINGER_STROKE, WHITEBOARD_HL_FINGER_DEFAULT_STROKE.ordinal());
                defaultSize = WHITEBOARD_HL_FINGER_DEFAULT_STROKE;
            } else {
                sizeEnumValue = prefs.getInt(KEY_WB_HL_STYLUS_STROKE, WHITEBOARD_HL_STYLUS_DEFAULT_STROKE.ordinal());
                defaultSize = WHITEBOARD_HL_STYLUS_DEFAULT_STROKE;
            }
        }

        for (HighlighterProperty.Size size : HighlighterProperty.Size.values()) {
            if (size.ordinal() == sizeEnumValue) {
                return size;
            }
        }

        return defaultSize;
    }

    public HighlighterProperty.Size getHighlighterSize() {
//        int sizeEnumValue = prefs.getInt(KEY_WB_HL_FINGER_STROKE, WHITEBOARD_HL_FINGER_DEFAULT_STROKE.ordinal());
        int sizeEnumValue = prefs.getInt(KEY_WB_HL_STYLUS_STROKE, WHITEBOARD_HL_STYLUS_DEFAULT_STROKE.ordinal());

        for (HighlighterProperty.Size size : HighlighterProperty.Size.values()) {
            if (size.ordinal() == sizeEnumValue) {
                return size;
            }
        }

        return WHITEBOARD_HL_FINGER_DEFAULT_STROKE;
    }

    public void resetPenSetting() {
        boolean isOEM = Props.getFlavorModel().equals(Props.Flavor.Model.Oem);
        prefs.edit().putInt(KEY_WB_PEN_STYLUS_COLOR, isOEM ? WB_PEN_STYLUS_DEFAULT_COLOR_OEM : WB_PEN_STYLUS_DEFAULT_COLOR).apply();
        prefs.edit().putInt(KEY_WB_PEN_FINGER_COLOR, isOEM ? WB_PEN_FINGER_DEFAULT_COLOR_OEM : WB_PEN_FINGER_DEFAULT_COLOR).apply();
        prefs.edit().putInt(KEY_WB_PEN_STYLUS_STROKE, WHITEBOARD_PEN_STYLUS_DEFAULT_STROKE.ordinal()).apply();
        prefs.edit().putInt(KEY_WB_PEN_FINGER_STROKE, WHITEBOARD_PEN_FINGER_DEFAULT_STROKE.ordinal()).apply();

        prefs.edit().putInt(KEY_AN_PEN_STYLUS_COLOR, isOEM ? AN_PEN_STYLUS_DEFAULT_COLOR_OEM : AN_PEN_STYLUS_DEFAULT_COLOR).apply();
        prefs.edit().putInt(KEY_AN_PEN_FINGER_COLOR, isOEM ? AN_PEN_FINGER_DEFAULT_COLOR_OEM : AN_PEN_FINGER_DEFAULT_COLOR).apply();
        prefs.edit().putInt(KEY_AN_PEN_STYLUS_STROKE, ANNOTATION_PEN_STYLUS_DEFAULT_STROKE.ordinal()).apply();
        prefs.edit().putInt(KEY_AN_PEN_FINGER_STROKE, ANNOTATION_PEN_FINGER_DEFAULT_STROKE.ordinal()).apply();
    }

    public void resetHighlighterSetting() {
        boolean isOEM = Props.getFlavorModel().equals(Props.Flavor.Model.Oem);
        prefs.edit().putInt(KEY_WB_HL_STYLUS_COLOR, isOEM ? WB_HL_STYLUS_DEFAULT_COLOR_OEM : WB_HL_STYLUS_DEFAULT_COLOR).apply();
        prefs.edit().putInt(KEY_WB_HL_FINGER_COLOR, isOEM ? WB_HL_FINGER_DEFAULT_COLOR_OEM : WB_HL_FINGER_DEFAULT_COLOR).apply();
        prefs.edit().putInt(KEY_WB_HL_STYLUS_STROKE, WHITEBOARD_HL_STYLUS_DEFAULT_STROKE.ordinal()).apply();
        prefs.edit().putInt(KEY_WB_HL_FINGER_STROKE, WHITEBOARD_HL_FINGER_DEFAULT_STROKE.ordinal()).apply();

        prefs.edit().putInt(KEY_AN_HL_STYLUS_COLOR, isOEM ? AN_HL_STYLUS_DEFAULT_COLOR_OEM : AN_HL_STYLUS_DEFAULT_COLOR).apply();
        prefs.edit().putInt(KEY_AN_HL_FINGER_COLOR, isOEM ? AN_HL_FINGER_DEFAULT_COLOR_OEM : AN_HL_FINGER_DEFAULT_COLOR).apply();
        prefs.edit().putInt(KEY_AN_HL_STYLUS_STROKE, ANNOTATION_HL_STYLUS_DEFAULT_STROKE.ordinal()).apply();
        prefs.edit().putInt(KEY_AN_HL_FINGER_STROKE, ANNOTATION_HL_FINGER_DEFAULT_STROKE.ordinal()).apply();
    }

    public void setReloadWhiteboardJsonFileSize(int size) {
        prefs.edit().putInt(KEY_RELOAD_WHITEBOARD_JSON_SIZE, size).apply();
    }

    public int getReloadWhiteboardJsonFileSize() {
        return prefs.getInt(KEY_RELOAD_WHITEBOARD_JSON_SIZE, 0);
    }

    public void setReloadWhiteboardJson(boolean reload) {
        prefs.edit().putBoolean(KEY_RELOAD_WHITEBOARD_JSON, reload).apply();
    }

    public boolean getReloadWhiteboardJson() {
        return prefs.getBoolean(KEY_RELOAD_WHITEBOARD_JSON, false);
    }

    public void setJsonSaveFolder(String fileName) {
        prefs.edit().putString(KEY_JSON_SAVE_FOLDER, fileName).apply();
    }

    public boolean isFake4k() {
        return Props.getMainboardVersion() == Props.Mainboard.V_811 || SystemPropertiesUtils.getBooleanValue(SystemPropertiesUtils.KEY_8386_4k2k, false);
    }

    public String getJsonSaveFolder() {
        return prefs.getString(KEY_JSON_SAVE_FOLDER, "");
    }

    public void setAutoScreenshotEnabled(boolean isAutoScreenshotEnabled) {
        prefs.edit().putBoolean(KEY_AUTO_SCREENSHOT, isAutoScreenshotEnabled).apply();
    }

    public boolean getAutoScreenshotIsEnabled () {
        // autoScreenshot defaults to false for oem, true for all other flavors
        return prefs.getBoolean(KEY_AUTO_SCREENSHOT, !Props.getFlavorModel().equals(Props.Flavor.Model.Oem));
    }

    private void log(String s) {
        Log.d(TAG, s);
    }

//    private static final String KEY_IMPLEMENT_RECOGNITION_MODE = "implementRecognitionMode";

    /**
     * All touch implements are recognized and fully supported.
     */
    public static final int IMPLEMENT_RECOGNITION_ALL = 0;
    /**
     * Stylus implements are allowed to draw, while finger implements operate in selection mode.
     */
    public static final int IMPLEMENT_RECOGNITION_SELECTIVE = 1;

//
//    // Page background settings
//    private static final String KEY_PAGE_MENU_COLOR_SETTING = "keyPageMenuColorSetting";
//
//    private static final String KEY_PAGE_MENU_PATTERN_SETTING = "keyPageMenuPatternSetting";
//
//    public static final PageProperty.Color PAGE_MENU_DEFAULT_COLOR = PageProperty.Color.BLUE;
//
//    public static final PageProperty.Color PAGE_MENU_DEFAULT_COLOR_OEM = PageProperty.Color.GREEN;
//
//    public static final PageProperty.Pattern PAGE_MENU_DEFAULT_PATTERN = PageProperty.Pattern.BLANK;

    private static final String KEY_IMPLEMENT_RECOGNITION_MODE = "implementRecognitionMode";

    private static final String KEY_AUTO_SCREENSHOT_MODE = "autoScreenshotMode";

    private static final String KEY_HINT_MODE = "hintMode";

    /**
     * When app is still running or on the background, save the visibility of hint dialog.
     * The dialog can only be visible once after the app has been restarted.
     */
    private static final String KEY_HINT_DIALOG_ADD_PAGE = "hintModeDialogAddPage";

    private static final String KEY_HINT_DIALOG_EDIT = "hintModeDialogEdit";

    /**
     * Detect that user closed the app by swiping the app on the background
     */
    private static final String KEY_DETECT_APP_CLOSED_FORCEFULLY = "detectAppClosedForcefully";

    /**
     * All touch implements are recognized and fully supported.
     * Mode : write with fine pen only
     */
//    public static final int IMPLEMENT_RECOGNITION_ALL = 0;

    /**
     * Stylus implements are allowed to draw, while finger implements operate in selection mode.
     * Mode : write with pen/finger
     */
//    public static final int IMPLEMENT_RECOGNITION_SELECTIVE = 1;

    public static final String KEY_TEST_INPUT = "KeyTestInput";

    /**
     * All touch implements are treated as the same type.
     */
    public static final int IMPLEMENT_RECOGNITION_OFF = 2;

    public static final int IMPLEMENT_RECOGNITION_ON_ONLY_PEN = 3;

    public static final int IMPLEMENT_RECOGNITION_ON_PEN_OR_FINGERS = 4;

    public static boolean DEFAULT_AUTO_SCREENSHOT_MODE = !Props.getFlavorModel().equals(Props.Flavor.Model.Oem);

    public static boolean DEFAULT_HINT_MODE = true;

    public static boolean DEFAULT_HINT_DIALOG_VISIBILITY = true;

    /**
     * Page background settings
     */
    private static final String KEY_PAGE_MENU_COLOR_SETTING = "keyPageMenuColorSetting";

    private static final String KEY_PAGE_MENU_PATTERN_SETTING = "keyPageMenuPatternSetting";

    public static final PageProperty.Color PAGE_MENU_DEFAULT_COLOR = PageProperty.Color.BLUE;

    public static final PageProperty.Color PAGE_MENU_DEFAULT_COLOR_OEM = PageProperty.Color.GREEN;

    public static final PageProperty.Pattern PAGE_MENU_DEFAULT_PATTERN = PageProperty.Pattern.BLANK;

    /**
     * Pen and highlighter stylus/finger color settings
     */
    private static final String KEY_WB_PEN_STYLUS_COLOR = "keyWhiteboardPenStylusColor";
    private static final String KEY_WB_PEN_FINGER_COLOR = "keyWhiteboardPenFingerColor";
    private static final String KEY_WB_HL_STYLUS_COLOR = "keyWhiteboardHighlighterStylusColor";
    private static final String KEY_WB_HL_FINGER_COLOR = "keyWhiteboardHighlighterFingerColor";
    private static final String KEY_AN_PEN_STYLUS_COLOR = "keyAnnotationPenStylusColor";
    private static final String KEY_AN_PEN_FINGER_COLOR = "keyAnnotationPenFingerColor";
    private static final String KEY_AN_HL_STYLUS_COLOR = "keyAnnotationHighlighterStylusColor";
    private static final String KEY_AN_HL_FINGER_COLOR = "keyAnnotationHighlighterFingerColor";

    private static final String KEY_WB_PEN_STYLUS_STROKE = "keyWhiteboardPenStylusStroke";
    private static final String KEY_WB_PEN_FINGER_STROKE = "keyWhiteboardPenFingerStroke";
    private static final String KEY_WB_HL_STYLUS_STROKE = "keyWhiteboardHighlighterStylusStroke";
    private static final String KEY_WB_HL_FINGER_STROKE = "keyWhiteboardHighlighterFingerStroke";
    private static final String KEY_AN_PEN_STYLUS_STROKE = "keyAnnotationPenStylusStroke";
    private static final String KEY_AN_PEN_FINGER_STROKE = "keyAnnotationPenFingerStroke";
    private static final String KEY_AN_HL_STYLUS_STROKE = "keyAnnotationHighlighterStylusStroke";
    private static final String KEY_AN_HL_FINGER_STROKE = "keyAnnotationHighlighterFingerStroke";

    /**
     * Json file
     */
    public static final String KEY_RELOAD_WHITEBOARD_JSON_SIZE = "keyReloadWhiteboardJsonSize";
    public static final String KEY_RELOAD_WHITEBOARD_JSON = "keyReloadWhiteboardJson";
    public static final String KEY_JSON_SAVE_FOLDER = "keyJsonSaveFolder";
    public static final String KEY_NEED_SHOW_TUTORIAL = "keyShowTutorial";

    public static @ColorInt int WB_PEN_STYLUS_DEFAULT_COLOR;
    public static @ColorInt int WB_PEN_FINGER_DEFAULT_COLOR;
    public static @ColorInt int WB_HL_STYLUS_DEFAULT_COLOR;
    public static @ColorInt int WB_HL_FINGER_DEFAULT_COLOR;

    public static PenProperty.Size WHITEBOARD_PEN_STYLUS_DEFAULT_STROKE = PenProperty.Size.ONE;
    public static PenProperty.Size WHITEBOARD_PEN_FINGER_DEFAULT_STROKE = PenProperty.Size.ONE;
    public static HighlighterProperty.Size WHITEBOARD_HL_STYLUS_DEFAULT_STROKE = HighlighterProperty.Size.TWO;
    public static HighlighterProperty.Size WHITEBOARD_HL_FINGER_DEFAULT_STROKE = HighlighterProperty.Size.TWO;

    public static @ColorInt int AN_PEN_STYLUS_DEFAULT_COLOR;
    public static @ColorInt int AN_PEN_FINGER_DEFAULT_COLOR;
    public static @ColorInt int AN_HL_STYLUS_DEFAULT_COLOR;
    public static @ColorInt int AN_HL_FINGER_DEFAULT_COLOR;

    public static PenProperty.Size ANNOTATION_PEN_STYLUS_DEFAULT_STROKE = PenProperty.Size.ONE;
    public static PenProperty.Size ANNOTATION_PEN_FINGER_DEFAULT_STROKE = PenProperty.Size.ONE;
    public static HighlighterProperty.Size ANNOTATION_HL_STYLUS_DEFAULT_STROKE = HighlighterProperty.Size.ONE;
    public static HighlighterProperty.Size ANNOTATION_HL_FINGER_DEFAULT_STROKE = HighlighterProperty.Size.ONE;

    public static @ColorInt int HEX_DEFAULT_COLOR;

    // OEM color set
    public static @ColorInt int WB_PEN_STYLUS_DEFAULT_COLOR_OEM;
    public static @ColorInt int WB_PEN_FINGER_DEFAULT_COLOR_OEM;
    public static @ColorInt int WB_HL_STYLUS_DEFAULT_COLOR_OEM;
    public static @ColorInt int WB_HL_FINGER_DEFAULT_COLOR_OEM;

    public static @ColorInt int AN_PEN_STYLUS_DEFAULT_COLOR_OEM;
    public static @ColorInt int AN_PEN_FINGER_DEFAULT_COLOR_OEM;
    public static @ColorInt int AN_HL_STYLUS_DEFAULT_COLOR_OEM;
    public static @ColorInt int AN_HL_FINGER_DEFAULT_COLOR_OEM;

    /**
     * Auto ScreenShot
     */
    public static final String KEY_AUTO_SCREENSHOT = "keyAutoScreenShot";
}
